<template>
  <div>
    <h1>home</h1>
    <hr />
    <router-link to="/home/test1">test1</router-link> &nbsp;&nbsp;
    <router-link to="/home/test2">test2</router-link>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: 'xxx',
  mounted() {
    console.log('home组件挂载了')
  },
  beforeDestroy() {
    console.log('home组件卸载了')
  },

  // 基于缓存路由组件的两个生命周期钩子函数
  activated() {
    console.log('home组件展示了')
  },
  deactivated() {
    console.log('home组件隐藏了')
  },
}
</script>

<style></style>
